package day20171122.test07;

public class Student {
    private String name;
    private int age;
    private String college;

    public Student() {
        age = 20;
    }

    public Student(String name) {
        this();
        this.name = name;
        System.out.println("This  student's  name  is  " + name);

    }

    public Student(String name, String college) {
        this(name); //c++中可以直接用Student(name)调用其他构造函数
        this.college = college;
        System.out.println("This  student's  name  is " + name + "  and the college is " + college);
    }

    public Student upgrade() {
        age++;
        return this;
    }

    public void print() {
        System.out.println("name  is  " + name + "  age is  " + age + "  college  is  " + college);
    }
}
